//
//  IMFCMService.h
//  DualMediationSDK
//
//  Created by YeJary on 2025/6/23.
//

#import <Foundation/Foundation.h>
#import "IMFCMModels.h"
#import "../../Utils/Network/IMNetworkUtils.h"

NS_ASSUME_NONNULL_BEGIN

// FCM上传回调类型定义
typedef void (^IMFCMSuccessBlock)(IMFCMResponse *response);
typedef void (^IMFCMFailureBlock)(NSError *error);

/**
 * FCM设备令牌上传服务类
 * 负责处理FCM设备令牌上传相关的网络请求
 */
@interface IMFCMService : NSObject

/**
 * 单例实例
 */
+ (instancetype)sharedService;

/**
 * 上传FCM设备令牌接口
 * @param appId 应用唯一ID
 * @param uuid 用户唯一ID
 * @param fcmToken 设备令牌
 * @param success 成功回调
 * @param failure 失败回调
 * @return 网络任务对象
 */
- (IMNetworkTask *)uploadFCMTokenWithAppId:(NSString *)appId
                                      uuid:(NSString *)uuid
                                  fcmToken:(NSString *)fcmToken
                                   success:(IMFCMSuccessBlock _Nullable)success
                                   failure:(IMFCMFailureBlock _Nullable)failure;

/**
 * 使用FCM请求模型上传设备令牌
 * @param request FCM请求模型
 * @param success 成功回调
 * @param failure 失败回调
 * @return 网络任务对象
 */
- (IMNetworkTask *)uploadFCMTokenWithRequest:(IMFCMRequest *)request
                                     success:(IMFCMSuccessBlock _Nullable)success
                                     failure:(IMFCMFailureBlock _Nullable)failure;

@end

NS_ASSUME_NONNULL_END